﻿<UserControl x:Class="SQLDeploy.Builder.Controls.Connections.Editor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:c="clr-namespace:SQLDeploy.Builder.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <c:BooleanReverseConverter x:Key="boolFlip"/>
        <DataTemplate x:Key="SQLDatabaseConnectionEditor">
            
        </DataTemplate>
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Label Grid.Row="0" Grid.Column="0"
                       Content="SQL Server:"/>
        <TextBox Grid.Row="0" Grid.Column="1"
                         Text="{Binding Path=DataSource}"/>

        <Label Grid.Row="1" Grid.Column="0"
                       Content="Database Name:"/>
        <TextBox Grid.Row="1" Grid.Column="1"
                         Text="{Binding Path=InitialCatalog}"/>

        <StackPanel Grid.Row="2" Grid.Column="1"
                            Orientation="Vertical">
            <GroupBox Header="Log on to the Server" >
                <StackPanel Orientation="Vertical" Margin="0,8,0,0" >
                    <RadioButton Name="chk_WindowsAuth"
                                 Content="Windows Authentication"
                                 Checked="{Binding Path=IntegratedSecurity}"/>
                    <RadioButton Name="chk_SqlAuth"
                                 Content="SQL Authentication"
                                 Checked="{Binding Path=IntegratedSecurity, Converter={StaticResource boolFlip}}"/>
                    
                    <Grid Name="SqlAuth">
                        
                    </Grid>
                </StackPanel>
            </GroupBox>

        </StackPanel>

    </Grid>
    
</UserControl>
